package com.tian.scroll;

import androidx.appcompat.app.AppCompatActivity;
import androidx.databinding.DataBindingUtil;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;

import com.tian.scroll.databinding.ActivityMainBinding;
import com.tian.scroll.gesture.GestureDetectorActivity;
import com.tian.scroll.nested_scroll.NestedScrollActivity;
import com.tian.scroll.pull.PullNestedScrollActivity;
import com.tian.scroll.view_move.MoveViewActivity;

/**
 * @author tiansongtao, Email:769001510@qq.com, created on 2021/1/19 14:39
 */
public class MainActivity extends AppCompatActivity implements View.OnClickListener {

    private ActivityMainBinding b;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        b = DataBindingUtil.setContentView(this, R.layout.activity_main);
        b.setListener(this);
    }

    @Override
    public void onClick(View v) {
        switch (v.getId()) {
            case R.id.mbt_view_move:
                startActivity(new Intent(this, MoveViewActivity.class));
                break;
            case R.id.mbt_gesture:
                startActivity(new Intent(this, GestureDetectorActivity.class));
                break;
            case R.id.mbt_nested_scroll:
                startActivity(new Intent(this, NestedScrollActivity.class));
                break;
            case R.id.mbt_pull_nested_scroll:
                startActivity(new Intent(this, PullNestedScrollActivity.class));
                break;
            default:
                break;
        }
    }
}